DISK SCHEDULING
Experiment Number 5 : LOOK
Algorithm
• Step 1: Let Request array represents an array storing indexes of tracks that have been requested in ascending order of their time of arrival. ‘head’ is the position of disk head.
• Step 2: The initial direction in which head is moving is given and it services in the same direction.
• Step 3: The head services all the requests one by one in the direction head is moving.
• Step 4: The head continues to move in the same direction until all the request in this direction are finished.
• Step 5: While moving in this direction calculate the absolute distance of the track from the head.
• Step 6: Increment the total seek count with this distance.
• Step 7: Currently serviced track position now becomes the new head position.
• Step 8: Go to step 5 until we reach at last request in this direction.
• Step 9: If we reach where no requests are needed to be serviced in this direction reverse the direction and go to step 3 until all tracks in request array have not been serviced.